<?php 
	$this->arrParam['id'] = 2;
	$title = 'Thời Trang Bé Trai';

	$tblItem = new Zendvn_Model_Table_Product();
	$arrItems = $tblItem->listItem($this->arrParam, array('task' => 'product-category'));
	if(!empty($arrItems)):
?>
<div class="featured-view">
	<h1><?php echo $title?></h1>
	<?php 
		$config 		= new Zendvn_Controller_Config(array('module'=>'admin',
															'fileConfig'=>'product-category.ini'));
		$itemConfig 	= $config->getconfig('item');
		$i = 0;
		$filter = new Zendvn_Filter_Filter();
		
		$xhtml = '<div class="row"><div class="row2"><ul id="feature-boy" class="feature-area">';
		foreach ($arrItems as $k => $v){
			$flagEnd 	= true;
			$id			= $v['id'];
			$name 		= Zendvn_Filter_Filter::filterContent($v['name'], 'filter');
			$picture 	= $v['image'];
			$no_price	= $v['no_price'];
			if(file_exists($itemConfig['thumbDir1'] . '/' . $picture) && !empty($picture)){
				$picture = $itemConfig['thumbUrl1'] . '/' . $picture;
			}else{
				$picture = FILE_URL . '/no-image.png';
			}
			
			$price 		= $v['price'];
			$sell_off	= $v['sale_price'];
			$newPrice 	= (empty($sell_off) || $sell_off == 0)?$price:$sell_off;
			$newPrice	= ($no_price == 1)?'Call':number_format($newPrice);
			
			$linkDetail = $this->cmsUrl(array(
											'module' => 'default',
											'controller' => 'index',
											'action' => 'product-detail',
											'id' => $id,
											'title' => $filter->filter($name)
											), 'product-detail');
			
			$xhtml .= '<li class="feature-item">
						<div class="lev x' . ($i + 1) . '">
							<div class="top_prod"></div>
							<div class="prod_img">
								<a href="' . $linkDetail . '"><img src="' . BLANK_IMG . '" style="background: #fff url(' . $picture . ') center center no-repeat" alt="' . $name . '" title="' . $name . '" /></a>
							</div>
							<div class="shadow"></div>
							<div class="prod_name">
								<a href="' . $linkDetail . '" title="' . $name . '">' . $name . '</a>
							</div>
							<div class="prod_price">
								<div class="prod_saleprice">' . $newPrice . '</div>
							</div>
						</div><div class="clr"></div></li>';
			$i++;
			if($i==5){
				$i=0;
			}
		}
		$xhtml .= '</ul></div></div>';
		echo $xhtml;
	?>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$('ul#feature-boy').bxSlider({
		minSlides: 1,
		maxSlides: 5,
		slideWidth: 185,
		slideMargin: 3,
		auto: true,
		speed: 2000,
	})
});
</script>
<?php endif;?>

